package kislo.dima.task4;

/**
 * *
 * @author Dima Kislo
 *
 */

public class Main {

	public static void main(String[] args) {
		int m = 3;
		int n = 3;
		System.out.print("Matrix A: ");
		Matrix a = MatrixFactory.createMatrix(m, n);
		System.out.println(a);
		System.out.print("Matrix B: ");
		Matrix b = MatrixFactory.createMatrix(n, m);
		System.out.println(b);

		// multiply
		try {
			System.out.print("A * B: ");
			Matrix resultMult = Multiplicator.multiply(a, b);
			System.out.println(resultMult);
		} catch (MultiplicationException e) {
			System.err.println("Error multiply!");
		}


		// plus
		try {
			System.out.print("A + B: ");
			Matrix resultPlus = PlusMinus.add(a, b);
			System.out.println(resultPlus);
		} catch (PlusMinusException e) {
			System.err.println("Error plus!");
		}

		// minus
		try {
			System.out.print("A - B: ");
			Matrix resultMinus = PlusMinus.subtract(a, b);
			System.out.println(resultMinus);
		} catch (PlusMinusException e) {
			System.err.println("Error minus!");
		}

	}

}
